package com.example.wastewater.controller;

import com.example.wastewater.common.convention.result.Result;
import com.example.wastewater.common.convention.result.Results;
import com.example.wastewater.dto.req.LogAddReqDTO;
import com.example.wastewater.service.IOperationLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class LogController {


    private final IOperationLogService operationLogService;

    @PostMapping("/api/waste-water/admin/v1/log-add")
    public Result<Void> logAdd(@RequestBody LogAddReqDTO requestParam) {
        operationLogService.logAdd(requestParam);
        return Results.success();
    }

    @GetMapping("/api/waste-water/admin/v1/get-logs")
    public Result<List<String>> getLogs() {
        return Results.success(operationLogService.getLogs());
    }
}

